import tokens from '../token'
const groupDB = [{    id: 1, name: "web组", teacherid: 2,},{
    id: 2, name: "算法组", teacherid: 2,
}]
export default [
    {
        path: "/api/group/getGroupByTeacher",
        method: "post",
        handle({ body }) {
            // if (body.token in tokens) {
                console.log(tokens);
                const group = groupDB.filter((item,) =>{return  item.teacherid ===tokens[body.token].id})
                return {
                    code: 0,
                    msg: '查询成功',
                    data: group
                }
            // } else {
            //     return {
            //         code: 500,
            //         msg: '登录失效，请重新登录',
            //         data: {}
            //     }
            // }
        }
    }
]